package com.dy.lock.screen.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dy.lock.screen.dao.UserDao;
import com.dy.lock.screen.pojo.UserInfo;
import com.dy.lock.screen.scoket.Head;
import com.dy.lock.screen.service.UserService;

@Service("userService")
public class UserServiceImpl implements UserService {

	@Resource(name = "userDao")
	private UserDao userDao;

	@Override
	public UserInfo queryByPrimaryKey(String id, Head head) {
		// TODO Auto-generated method stub
		UserInfo user = new UserInfo();
		user.setUserId(id);
		return this.userDao.queryByPrimaryKey(user);
	}

	@Override
	public int save(UserInfo userInfo, Head head) {
		// TODO Auto-generated method stub
		return this.userDao.insert(userInfo);
	}

	@Override
	public int update(UserInfo userInfo, Head head) {
		// TODO Auto-generated method stub
		return this.userDao.update(userInfo);
	}

	@Override
	public UserInfo queryByMyInviteCode(String myInviteCode, Head head) {
		// TODO Auto-generated method stub
		return this.userDao.queryByMyInviteCode(myInviteCode);
	}

	@Override
	public int updatePwd(UserInfo info, Head head) {
		// TODO Auto-generated method stub
		return this.userDao.updatePwd(info);
	}

	@Override
	public UserInfo queryByMobile(String mobile, Head head) {
		// TODO Auto-generated method stub
		return this.userDao.queryByMobile(mobile);
	}

	@Override
	public UserInfo queryByUserId(String userId, Head head) {
		// TODO Auto-generated method stub
		return this.userDao.queryByUserId(userId);
	}

	@Override
	public List<UserInfo> getUserListByUserIds(Map<String, Object> para) {
		// TODO Auto-generated method stub
		return this.userDao.getUserListByUserIds(para);
	}

	@Override
	public List<UserInfo> queryPage(Map<String, Object> para) {
		// TODO Auto-generated method stub
		return this.userDao.queryT(para);
	}

	@Override
	public UserInfo queryPersonalInfoByUserId(String userId) {
		// TODO Auto-generated method stub
		return this.userDao.queryPersonalInfoByUserId(userId);
	}

	@Override
	public List<UserInfo> getUserListByMobiles(Map<String, Object> para) {
		// TODO Auto-generated method stub
		return this.userDao.getUserListByMobiles(para);
	}

	@Override
	public List<String> getUserIdList(Map<String, Object> para) {
		// TODO Auto-generated method stub
		return this.userDao.getUserIdList(para);
	}

	@Override
	public Integer queryCount(Map<String, Object> para) {
		// TODO Auto-generated method stub
		return this.userDao.queryCount(para);
	}

	@Override
	public List<UserInfo> queryFansOfOnehundred() {
		// TODO Auto-generated method stub
		return this.userDao.queryFansOfOnehundred();
	}

}
